package com.zhoutao123.hephaestus.controller;

import com.zhoutao123.hephaestus.object.bussiness.VBlogLook;
import com.zhoutao123.hephaestus.service.BlogLookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/blog-look")
@Api(tags = "文章相关接口")
public class BlogLookController {

  @Autowired BlogLookService blogLookService;

  @PostMapping(value = "/{blogId}")
  @ApiOperation(value = "增加指定文章的阅读量")
  public VBlogLook getListById(@PathVariable("blogId") String blogId, @RequestParam String userIp) {

    return blogLookService.add(blogId, userIp);
  }
}
